package com.easycarebn.main.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.easycarebn.main.utils.IResult;
import com.easycarebn.main.utils.Utils;
import com.timbacsi.main.R;

public class FragmentPolicy extends Fragment {

	private View mView;
	private static FragmentPolicy fragment = null;
	private IResult callIResult;
	private static String mTitle;

	public static FragmentPolicy newInstance(String title) {
		if (fragment == null)
			fragment = new FragmentPolicy();
		mTitle = title;
		return fragment;
	}

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if (activity instanceof IResult) {
			callIResult = (IResult) activity;
		}
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mView = inflater.inflate(R.layout.fragment_about, null);

		return mView;
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		Utils.setTitlePage(mView, mTitle);
		callIResult.onDisplay(Utils.TASK_CHILD, "");

		TextView lblContent = (TextView) mView
				.findViewById(R.id.lblContentAbout);
		lblContent.setText(Html.fromHtml(getResources().getString(
				R.string.lblcontentAb)));

	}
}
